package com.common.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.common.dto.ArticleDTO;
import com.common.model.Article;
import com.common.query.ArticleQueryParam;

import java.util.List;
import java.util.Map;

public interface ArticleService {

    List<ArticleDTO> findAll(ArticleQueryParam articleQueryParam);

    List<ArticleDTO> findHotArticlesWithUser(int size);

    List<ArticleDTO> findNewArticlesWithUser(int size);

    ArticleDTO findWithUserByArticleId(long id);

    List<Map> getArticleArchives();

    int saveByForm(Article article);

    int getHotNumber(Article article);

    int countByCategoryId(Long categoryId);

    boolean edit(Long id, Article article);

    boolean readNumInc(Long id);

    void delete(long id);

    IPage<Article> findAll(
            Integer page,
            Integer pageSize
    );

    IPage<ArticleDTO> findAll(
            Integer page,
            Integer pageSize,
            ArticleQueryParam articleQueryParam
    );

}
